import request from './request.js'

export function searchProblemFromServe(name) {
  return request({
    url: '/question/search/'+name,
    method: 'post',
  })
}

export function getProblemFromServe(id) {
  return request({
    url: '/question',
    params:{id:id},
    method: 'get'
  })
}
export function getCommonFromServe(){
  return request({
    url: '/common',
    method: 'get'
  })
}
export function getCollectionFromServe(userId){
  return request({
    url: '/question/'+userId,
    method: 'get'
  })
}
export function CollectProblem(id){
  return request({
    url: '/question/'+id,
    // params:{id:id},
    method: 'put',
  })
}
export function CancelCollectProblem(questionId){
  return request({
    url: '/question/cancelCollection/'+questionId,
    method: 'delete',
  })
}
export function isCollected(questionId){
  return request({
    url: '/question/isCollected/'+questionId,
    method: 'get'
  })
}